# -*- coding:utf-8 -*-

from flask import Flask, request, jsonify, render_template,redirect, url_for
from utils import SEXxnxx


app = Flask(import_name=__name__, static_url_path="/static", static_folder="static",template_folder="templatesWeb")

@app.route('/')
def home():
    return render_template(
        'home.html')

@app.route('/pc/', methods=['GET'])
def index():
    return redirect('/pc/1')


@app.route('/pc/<id>', methods=['GET'])
def indexpage(id):

    page = int(id)
    pageu = page -1
    paged = page +1
    if(page == 1):
        pageu = 1

    all , allmp4 = SEXxnxx.getlistgif(id)
    return render_template(
        'index.html',
        lists=list,
        listmp4=allmp4,
        pageup=pageu,
        pagedown=paged
    )




@app.route('/m/', methods=['GET'])
def indmobileginde1():
    return redirect('/m/1')


@app.route('/m/<id>', methods=['GET'])
def indmobilege(id):
    page = int(id)
    pageu = page -1
    paged = page +1
    if(page == 1):
        pageu = 1

    all , allmp4 = SEXxnxx.getlistgif(id)
    return render_template(
        'mobile.html',
        lists=all,
        listmp4=allmp4,
        pageup=pageu,
        pagedown=paged
    )








if __name__ == "__main__":
    app.run(host="0.0.0.0", port=56789)
